package com.lihepeng.leecode.open_source_test.jrule;

import org.jeasy.rules.annotation.Action;
import org.jeasy.rules.annotation.Condition;
import org.jeasy.rules.annotation.Fact;
import org.jeasy.rules.annotation.Rule;

@Rule(name = "weatherRule",description = "when it is rain then  take an  unbrella ")
public class WeatherRule {
    @Condition
    public boolean itrains(@Fact(value = "rain") boolean rain){
        return rain;
    }
    @Action
    public void takeUmbrella(){
        System.out.println("下雨了，带把伞！！");
    }

}
